<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link rel="stylesheet" type="text/css" href="<?php echo $this->_webroot('skin/css/admin.css'); ?>">
<link rel="stylesheet" type="text/css" href="<?php echo $this->_webroot('skin/css/main.css'); ?>">

<script language='javascript'>
function create_xmlhttp()
{
	if(window.ActiveXObject){
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		xmlhttp=new XMLHttpRequest();
	}
}
function del_file(file_id)
{
	 create_xmlhttp();
	 xmlhttp.open("GET","<?php echo $this->_url('admin/database/recover/');?>?fid="+file_id,true);
	 xmlhttp.onreadystatechange=function(){
		 if(xmlhttp.readyState==4&&xmlhttp.status==200){
		 	var return_str=xmlhttp.responseText;
			var	return_text=return_str.replace(/[\s\n\r]/g,"");
		 	window.document.getElementById("operate_"+file_id).innerHTML=return_text;
		 	window.document.getElementById("d_operate_"+file_id).innerHTML='';
	 	 }
	 }
	 xmlhttp.send(null);
}
</script>
<style>
td span {color:red;}
.green {color:green;}
.red {color:red;}
</style>
</head>
<body>
<input type="hidden" id="update_right" value="0" ></input>
<div id="maincontent">
<psp:tags     htmlname='messagebox'  iconname='messagebox' />
	<div class="wrap">
       <div class="crumbs">当前位置 &gt;&gt; 系统设置 &gt;&gt; 数据库恢复</div>
        <hr />

	
		
	<div class="infobox">
    <h3><span class="left">数据库恢复</span></h3>
    <div class="content2">

	  <form action="<?php echo $this->_url('admin/database/recover/');?>?operation=post" method="post">
	    <TABLE class="list_table" >
		<thead>
          <tr style="text-align:center;">
	        <th style="width:40px;">ID </th>
	        <th align="left">文件名</th>
			<th>占用空间</th>
	        <th>版本</th>
	        <th>备份时间</th>
	        <th width="40">导入</th>
	        <th width="40">删除</th>
	      </tr>
	      </thead>
	      <tbody>

	      <?php foreach($file_array as $key=>$val){?>
	      <tr style="text-align:center;">
	        <td><?php echo $key+1;?></td>
	        <td align="left"><?php echo $val['0'];?></td>
	        <td></td>
	        <td></td>
	        <td></td>
	        <td>
	        	<div id=operate_<?php echo $val['0'];?>>
	        		<a href="<?php echo $this->_url('admin/database/recover/');?>?operation=bakin&pre=<?php echo $val['0']?>" onclick='return confirm("您确定要导入此数据库吗？");");'>导入</a>
	       		</div>
	        </td>
	        <td>
	        	<div id=d_operate_<?php echo $val['0'];?>>
		        	<a href='javascript:del_file(<?php echo "\"".$val['0']."\"";?>);' title="删除" alt="删除" onclick='return confirm("您确认删除吗？");'>删除</a>
	        	</div>
	        </td>
	      </tr>
	      <div id="filedb">
	      <?php foreach($filedb[$key] as $n=>$file){?>
	      <tr style="text-align:center;">
	        <td></td>
	        <td align="left"><?php echo $file['name'];?></td>
			<td class="center"><?php echo $file['MB'];?></td>
	        <td class="center"><?php echo $file['version'];?></td>
	        <td class="center"><?php echo $file['time'];?></td>
	        <td></td>
	        <td></td>
	      </tr>
	      <?php }?>
	      </div>
	      <?php }?>
	      </tbody>
	    </table>
	  </form>
	
	
	
	
	
	
	  </div>
	 </div>
	</div>
</div>

</body>
</html>